#include"mysplines.h"
#include<iostream>
using namespace std;

int main() {
	int N = 81;
	vector<double> xarr, yarr;
	xarr.resize(N); yarr.resize(N);
	for (int i = 0; i < N; i++) {
		xarr[i] = -1.0 + 2.0 * i / (N - 1.0);
		yarr[i] = 1.0 / (1.0 + 25 * pow(xarr[i], 2));
	}
	double d1 = 50.0 / 676;
	double d2 = -d1;
	ppform workA(xarr, yarr, d1, d2, N, 1);
	workA.solve();
	ofstream fout;
	fout.open("adata5.txt");
	for (int k = 0; k <= 100; k++) {
		double x[101] = { 0 };
		double y[101] = { 0 };
		x[k] = -1 + 0.02 * k;
		y[k] = workA.func(x[k]);
		fout << x[k] << " " << y[k] << endl;
	}
	fout.close();
}